package com.kingmed.kmss.common.enums.admin;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 组织机构类型 固定
 */
@Getter
@AllArgsConstructor
public enum OrgType {

    GROUP(1, "集团", "US3TP3eIJgbgU0A+qMDqhoRbQ4A="),
    BRANCH(2, "公司", "US3TP3eJJgbgU0A+qMDqhoRbQ4A="),
    DEPT(3, "部门", "US3TP3eKJgbgU0A+qMDqhoRbQ4A="),
    OTHER(4, "其他", "");

    private final Integer code;
    private final String name;
    private final String hrId;

    public static Integer getCodeByHrID(String hrID) {
        for (OrgType value : values()) {
            if (value.getHrId().equals(hrID)) {
                return value.getCode();
            }
        }
        return 0;
    }
}
